import Layout from '@/layout'

export const asyncRoutes = [
  {
    path: '/school',
    component: Layout,
    meta: {permission:['admin'] },
    children: [
      {
        path: '',
        name: 'student',
        component: () => import('@/views/school/index'),
        meta: { title: '校区管理', icon: 'table' }
      }
    ]
  },{
  path: '/student',
  component: Layout,
  meta: {permission:['admin']},
  children: [
    {
      path: '',
      name: 'student',
      component: () => import('@/views/student/index'),
      meta: { title: '学员管理', icon: 'table' }
    }
  ]
},{
  path: '/teacher',
  component: Layout,
  meta: {permission:['teacher','admin']},
  children: [
    {
      path: '',
      name: 'teacher',
      component: () => import('@/views/teacher/index'),
      meta: { title: '教员管理', icon: 'table'}
    }
  ]
},{
  path: '/department',
  component: Layout,
  meta: {permission:['teacher','admin']},
  children: [
    {
      path: '',
      name: 'department',
      component: () => import('@/views/department/index'),
      meta: { title: '院系管理', icon: 'table'}
    }
  ]
},{
  path: '/curriculum',
  component: Layout,
  meta: {permission:['teacher','admin']},
  children: [
    {
      path: '',
      name: 'curriculum',
      component: () => import('@/views/curriculum/index'),
      meta: { title: '课程管理', icon: 'table'}
    }
  ]
},{
  path: '/task',
  component: Layout,
  meta: {permission:['teacher','admin']},
  children: [
    {
      path: '',
      name: 'task',
      component: () => import('@/views/task/index'),
      meta: { title: '作业管理', icon: 'table'}
    }
  ]
},{
  path: '/banji',
  component: Layout,
  meta: {permission:['teacher','admin']},
  children: [
    {
      path: '',
      name: 'banji',
      component: () => import('@/views/banji/index'),
      meta: { title: '班级管理', icon: 'table'}
    }
  ]
}
,{
  path: '/userInfo',
  component: Layout,
  meta: {permission:['teacher','admin','student']},
  children: [
    {
      path: '',
      name: 'userInfo',
      component: () => import('@/views/userInfo'),
      meta: {title: '个人信息', icon: 'user'}
    }
  ]
},
  { path: '*', redirect: '/404', hidden: true,meta: {permission:['teacher','admin','student'] } }
]
